CC = gcc
# sem DEBUG
CFLAGS = -Wall -ansi -pedantic-errors -ggdb3
# com DEBUG
#CFLAGS = -Wall -ansi -pedantic-errors -ggdb3 -g -DDEBUG
# com DEBUG e DEBUG_JSTACK
#CFLAGS = -Wall -ansi -pedantic-errors -ggdb3 -g -DDEBUG -DDEBUG_JSTACK
OBJECTS = javaclass.o simperr.o main.o engine.o heap.o stack.o

jvm : $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o jvm

main.o : main.c
	$(CC) $(CFLAGS) -c main.c

javaclass.o : javaclass.c
	$(CC) $(CFLAGS) -c javaclass.c

simperr.o : simperr.c
	$(CC) $(CFLAGS) -c simperr.c

engine.o : engine.c
	$(CC) $(CFLAGS) -c engine.c

heap.o : heap.c
	$(CC) $(CFLAGS) -c heap.c

stack.o : stack.c
	$(CC) $(CFLAGS) -c stack.c

engine_test : engine.o simperr.o javaclass.o
	$(CC) $(CFLAGS) engine.o simperr.o javaclass.o engine_test.c -o engine_test

clean:
	rm -Rf *.o jvm

